Skip to main content
Version: 1.7.0

Simulating the delay of script function execution

Introduction

An experiment that simulates the delay of script function execution will be performed after specifying the script and its function.

CLI Command

  • blade create script delay -h

Parameter

NameIntroductionTypeRequiredExample Value
timeTime of delay(ms)intY10000
filePath to the scriptstringYtest.sh
function-nameFunction name in the scriptstringYstart0
timeoutRunning time(s)intN30

Case

# blade create script delay --time 10000 --file test.sh --function-name start0
{"code":200,"success":true,"result":"b6a0f477b7fb1f4c"}

# The sleep command will be added to the script:
start0() {
sleep 10.000000
...
}

Principle

After backing up the original script, the sleep command will be added to the function by the function name. Finally, the original script will be restored after the experiment is destroyed.

Q&A

Q: {"code":602,"success":false,"error":"get too many lines by the install function name"}

A:Execution failed because multiple functions were found.